import { Component } from '@angular/core';
import { IonicPage, NavController, NavParams } from 'ionic-angular';
import { BusiProvider } from '../../providers/busi/busi';

/**
 * Generated class for the MettinglistPage page.
 *
 * See https://ionicframework.com/docs/components/#navigation for more info on
 * Ionic pages and navigation.
 */

@IonicPage()
@Component({
  selector: 'page-mettinglist',
  templateUrl: 'mettinglist.html',
})
export class MettinglistPage {
  selectedseg = "0";
  mettinglist=[];
  constructor(public navCtrl: NavController, public navParams: NavParams, public busi: BusiProvider) {
  }
  ionViewDidEnter(){
    this.getMettingList();
  }
  ionViewDidLoad() {
    console.log('ionViewDidLoad MettinglistPage');
  }

  getMettingList() {
    this.busi.getAllMetting(this.selectedseg).subscribe(
      data=>{
        this.mettinglist = data.mettinglist;
      },err=>{

      }
    );
  }
  gotoMettingDetail(metting){
    this.navCtrl.push("MettingdetailPage",{mettingid:metting.id});
  }
}
